package com.naton.common.utils

import android.view.View
import io.reactivex.ObservableTransformer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

object RxUtils {
    fun <T> io2main(): ObservableTransformer<T, T> {
        return ObservableTransformer { observable ->
            observable.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
        }
    }
    fun <T> downloadFile(): ObservableTransformer<T, T> {
        return ObservableTransformer { observable ->
            observable.subscribeOn(Schedulers.io())
                    .observeOn(Schedulers.io())
                    .observeOn(Schedulers.computation())
        }
    }



    interface OnTextChangeInterf{
        fun onTextChanged(text : String)
    }

    interface OnClickInterf{
        fun onViewClick(view : View)
    }
}